package com.valley.dream.tihai.view.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.valley.dream.tihai.R;
import com.valley.dream.tihai.presenter.IProblemPresenter;
import com.valley.dream.tihai.presenter.ITypePresenter;
import com.valley.dream.tihai.presenter.impl.ProblemPresenterImpl;
import com.valley.dream.tihai.presenter.impl.TypePresenterImpl;
import com.valley.dream.tihai.util.result.Result;

public class CommunityActivity extends AppCompatActivity {

    IProblemPresenter problemPresenter = new ProblemPresenterImpl();
    ITypePresenter typePresenter = new TypePresenterImpl();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_community);
    }

    @Override
    protected void onResume() {
        super.onResume();
        initView();
    }

    private void initView() {
        String typeId = getIntent().getStringExtra("id");
        int id = Integer.parseInt(typeId);
        Result typeResult = typePresenter.selectTypeById(this, id);
        Result problemResult = problemPresenter.selectProblemByType(this, id);
    }
}
